def add_numbers(a, b):
    result = a + b
    return result
    # 调用函数


sum_result = add_numbers(3, 4)
print("结果:", sum_result)


def greet(name="Guest"):
    print(f"Hello, {name}!")  # 输出 "Hello, Guest!"


greet("Alice")  # 输出 "Hello, Alice!"


def calculate_sum(*numbers):
    result = 0
    for num in numbers:
        result += num
    return result


total = calculate_sum(1, 2, 3, 4)
print("总和:", total)  # 输出 "总和: 10"


def bubble_sort(*args):
    arr = list(args)
    n = len(arr)
    for i in range(n):
        for j in range(0, n - i - 1):
            if arr[j] > arr[j + 1]:
                arr[j], arr[j + 1] = arr[j + 1], arr[j]
    return arr


bubble = bubble_sort(3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5)

print("排序:", bubble)  # 排序: [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]
